Program R https://www.r-project.org/
RStudio https://www.rstudio.com/products/RStudio/
GitHub account https://github.com/
Private repositories are helpful for research projects in progress, protecting your work until you are ready to publish.
Althea created the repository for the reproducibility workshop on her GitHub account (https://github.com/aaarchmiller/reproducibility_workshop). John Fieberg and her are the only ones that have direct editing privileges; however, anyone can create a “clone” of the repository (aka a “forked branch”) and edit it on their own computer. Changes can then be sent back to Althea as a “pull request,” which she can either ignore or merge with the main “branch.”
Once you have a repository set up on GitHub and synced with RStudio, you can make changes, “commit” them with an associated “commit message,” and then “push” them back to your branch (which will likely be the “master branch” if it is your respository or a “forked branch” if it is a clone of another repository). You will also need to “pull” the most up-to-date files from GitHub to your local cloned version of the repository if you have made changes on another computer, on GitHub directly, or if someone else is making changes directly to the main branch.
At the end of this introduction, you will add your name to the workshop roll call, signalling to the instructors that you have successfully set up GitHub. If at any point you run across errors or concerns, please email Althea at althea.archmiller [at] gmail [dot] com.
An SSH key allows your computer to talk directly with your GitHub account. Only do this step on a computer that you will frequently be using with RStudio and GitHub. If you are on a public computer or a borrowed laptop for the workshop, we recommend skipping this step.
Click on Git/SVN tab on left column of Global Options
The default path should be fine, so I recommend leaving at default.
Click “Create” and you will see something like this:
Click “Close” and then “View Public Key” and you should see something like this:
Click on the SSH and GPG keys tab on the left column, and you should see something like this (although empty because you have yet to add a key):
Click green “Add SSH key” button.
Now you’re all set!
In this section, you will clone a verison of the workshop repository to your computer and eventually modify the text file “roll_call” so that the instructors can verify that you have successfully prepared for the workshop activities. (These steps follow http://r-bio.github.io/intro-git-rstudio/.)
Click “Fork” in the upper right hand corner. This will create a cloned branch in your own GitHub account (Forked Branch in the image above). Copy the URL for your branch (something like: https://github.com/yourusername/reproducibility_workshop).
Open RStudio, go to File > New Project
Select “Version Control” and Git
Paste in the URL for your branch (something like: https://github.com/yourusername/reproducibility_workshop). Make sure you’re happy with the location on the harddrive that it will be saved to and select “Create Project”
Now, in order to link this project with Althea’s “upstream” version, we will use the shell and the git language directly. Open the shell by selecting Tools > Shell…
Type in (exactly) and hit Enter:
git remote add upstream https://github.com/aaarchmiller/reproducibility_workshop
git checkout -b conduct-rollcall master
This creates a new branch called “conduct-rollcall” on your repository.
Click “Commit” button and a new window should appear:
Enter shell again and type in this (exactly) and hit Enter:
git push origin conduct-rollcall
Now, you have changed roll_call in your “conduct-rollcall” branch, but now you need to merge it back with your main repository.
You have successfully changed “roll_call” document on your forked branch, but now you need to send it to the instructors to merge with the original branch. You have to just follow the same instructions above, but this time, starting at “https://github.com/aaarchmiller/reproducibility_workshop” in step [1]. (Step [8] will not apply.)
If you have completed all of these steps, you are now ready to participate in the workshop. Again, contact Althea (althea.archmiller [at] gmail [dot] com) if you have any problems!